﻿using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using System.Web;

namespace Model
{

    [MetadataType(typeof(AddressBook_Metadata))]
    [DisplayName("通讯簿")]
    public partial class AddressBook
    {
        public AddressBook()
        {
            this.Id = Guid.NewGuid();
            this.AddDate = DateTime.Now;
            this.ModiDate = DateTime.Now;
            this.UserId = new Guid(HttpContext.Current.User.Identity.Name);
        }

        public class AddressBook_Metadata
        {
            [ScaffoldColumn(false)]
            public System.Guid Id { get; set; }

            [ScaffoldColumn(false)]
            public System.Guid UserId { get; set; }

            [DisplayName("联系人类型")]
            [DropDownList("AddressBookType", "Id", "Type")]
            public object TypeId { get; set; }

            [DisplayName("联系人姓名")]
            [Required]
            public object ContactName { get; set; }

            [DisplayName("联系人头衔")]
            [DisplayFormat(ConvertEmptyStringToNull = false)]
            public object ContactTitle { get; set; }

            [DisplayName("公司名称")]
            [DisplayFormat(ConvertEmptyStringToNull = false)]
            public object CompanyName { get; set; }

            [DisplayName("电话号码")]
            [DisplayFormat(ConvertEmptyStringToNull = false)]
            public object TelephoneNumber { get; set; }

            [DisplayName("手机号码")]
            [DisplayFormat(ConvertEmptyStringToNull = false)]
            public object MobilePhoneNumber { get; set; }

            [DisplayName("电子邮件")]
            [DataType(DataType.EmailAddress)]
            [DisplayFormat(ConvertEmptyStringToNull = false)]
            public object Email { get; set; }

            [DisplayName("网址")]
            [DataType(DataType.Url)]
            [DisplayFormat(ConvertEmptyStringToNull = false)]
            public object Url { get; set; }

            [DisplayName("出生日期")]
            [DataType(DataType.Date)]
            [DisplayFormat(ConvertEmptyStringToNull = false)]
            public object DateOfBirth { get; set; }

            [DisplayName("联系地址")]
            [DisplayFormat(ConvertEmptyStringToNull = false)]
            public object ContactAddresses { get; set; }

            [DisplayName("备注信息")]
            [DisplayFormat(ConvertEmptyStringToNull = false)]
            [DataType(DataType.MultilineText)]
            public object NoteInformation { get; set; }

            [ScaffoldColumn(false)]
            [DisplayName("添加日期")]
            [DisplayFormat(ConvertEmptyStringToNull = false)]
            public object AddDate { get; set; }

            [ScaffoldColumn(false)]
            [DisplayName("修改日期")]
            [DisplayFormat(ConvertEmptyStringToNull = false)]
            public object ModiDate { get; set; }
        }
    }
}
